********************************************************************************
* This is the replication code for the Supplementary information for 		   *
* Attitudes Toward Voting-Rights requirements by Hultin Rosenberg and Wejryd.  *
*																			   *	
* It is to be run on the LONG dataset, in which each PROFILE is one unit	   *
********************************************************************************

********************************************************************************
* Preparations 																   *
********************************************************************************
* Clustering standard errors on respondent*
global ses ", cluster (ResponseId)"

* Install coefplot if not already done*
ssc install coefplot

* To reporoduce the style, get "lean-scheme": * 
lookup lean1 // Then activate lean1 and Times new roman by making a graph, 
// right-click it, and choose Alternatives.

********************************************************************************
* For Part A - see the do-file for descriptive stats 						   *
********************************************************************************

********************************************************************************
* Part B - robustness checks for AMCEs				 						   *
********************************************************************************

* Figure B1. AMCEs in subset with respondent who gave no conflicting answers, 
* and inclusive model as reference

reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1$ses
est sto Main

reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1 & conflicter==0$ses
est sto Restricted

* PLOT 
coefplot Restricted Main, drop(?cons) xline(0) omitted baselevels ///
				headings(1.profilecitizenship = "{bf:Citizenship}" 		///
						 1.profiletaxpayer = "{bf:Tax paying}"     ///
						 1.profileresidence = "{bf:Residence}"	 		///
						 1.profileborn = "{bf:Country of origin}"   		///
						 1.profileedu = "{bf:Education level equivalent to}" ///
						 1.profilegender = "{bf:Gender}") ///
mfcolor(white) lcolor(black*.7) xline(0) grid(between) graphregion(fcolor(white)) ///
ciopts(lcolor(black) lwidth(*.3)) msize(tiny) ci(95) aspect() byopts(row(1)) ///
scheme(lean1) xtitle("Effect on Pr(Chosen in pairwise comparison)", size(small)) 


* Figure B2. AMCE without and with controls for other attributes of the profile 

quietly reg chosen i.profilecitizenship if use==1$ses
est sto a

quietly reg chosen i.profiletaxpayer  if use==1$ses
est sto b

quietly reg chosen b5i.profileresidence if use==1$ses
est sto c 

quietly reg chosen b5i.profileborn if use==1$ses
est sto d 

quietly reg chosen i.profileedu if use==1 $ses
est sto e

quietly reg chosen b2i.profilegender if use==1 $ses
est sto f

quietly reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1$ses
est sto Main

coefplot a b c d e f Main, drop(?cons) xline(0) omitted baselevels ///
				headings(1.profilecitizenship = "{bf:Citizenship}" 		///
						 1.profiletaxpayer = "{bf:Tax paying}"     ///
						 1.profileresidence = "{bf:Residence}"	 		///
						 1.profileborn = "{bf:Country of origin}"   		///
						 1.profileedu = "{bf:Education level equivalent to}" ///
						 1.profilegender = "{bf:Gender}") ///
mfcolor(white) lcolor(black*.7) xline(0) grid(none) graphregion(fcolor(white)) ///
ciopts(lcolor(black) lwidth(*.3)) msize(vsmall) ci(95) aspect() byopts(row(1)) ///
scheme(lean1) xtitle("Effect on Pr(Chosen in pairwise comparison)", size(small)) 


* Figure B3. AMCEs on different rounds of choices (1-6)

recode profilenumber (11 12 = 1) (21 22 = 2) (31 32 = 3) (41 42 = 4) (51 52 = 5) (61 62 = 6), generate(tasknumber)

quietly reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1 & tasknumber==1 $ses
est sto First

quietly reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1 & tasknumber==2 $ses
est sto Second	

quietly reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1 & tasknumber==3 $ses
est sto Third

quietly reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1 & tasknumber==4 $ses
est sto Fourth

quietly reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1 & tasknumber==5 $ses
est sto Fifth

quietly reg chosen i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1 & tasknumber==6 $ses
est sto Sixth

coefplot First Second Third Fourth Fifth Sixth, drop(?cons) xline(0) omitted baselevels ///
				headings(1.profilecitizenship = "{bf:Citizenship}" 		///
						 1.profiletaxpayer = "{bf:Tax paying}"     ///
						 1.profileresidence = "{bf:Residence}"	 		///
						 1.profileborn = "{bf:Country of origin}"   		///
						 1.profileedu = "{bf:Education level equivalent to}" ///
						 1.profilegender = "{bf:Gender}") ///
mfcolor(white) lcolor(black*.7) xline(0) graphregion(fcolor(white)) ///
ciopts(lcolor(black) lwidth(*.3)) msize(vsmall) ci(95) aspect() byopts(row(1)) ///
scheme(lean1) ///
title ("Average marginal component effects in each round of choices", size (medsmall)) ///
xtitle("Effect on Pr(Chosen in pairwise comparison)", size(small)) 


* Figure B4. Ratings based AMCEs

reg ratingprofile i.profilecitizenship i.profiletaxpayer  b5i.profileresidence ///
b5i.profileborn i.profileedu b2i.profilegender if use==1$ses

est sto _choicemodelisyntax
* PLOT 

coefplot _choicemodelisyntax, drop(?cons) xline(0) omitted baselevels ///
				headings(1.profilecitizenship = "{bf:Citizenship}" 		///
						 1.profiletaxpayer = "{bf:Tax paying}"     ///
						 1.profileresidence = "{bf:Residence}"	 		///
						 1.profileborn = "{bf:Country of origin}"   		///
						 1.profileedu = "{bf:Education level equivalent to}" ///
						 1.profilegender = "{bf:Gender}") ///
mfcolor(white) lcolor(black*.7) xline(0) graphregion(fcolor(white)) ///
ciopts(lcolor(black*.7) lwidth(*1)) msize(small) ci(95) aspect(1) byopts(row(1)) ///
scheme(lean1) xtitle("Effect on rating 1-7", size(small)) 

********************************************************************************
* Part C - robustness checks and heterogeneous effects in ratings			   *
********************************************************************************

* Figure C1. Comparison between main model, inclusive alternative, and exclusive alternative

* C1 First panel: main model as reference

gen all=use if conflicter==0
replace all=0 if conflicter==1 // The model for figure 3-4 is restricted 
// to the most attentitive respondents to avoid that noise creates a bias 
// towards 50 % (or rather 3/7) support for all groups.
// The all-variable above restricts all subsamples to the most attentitive 
// respondents, by excluding all responses from respondents that made 
// contradictory choices and ratings of profiles ("conflicter"). 

gen cityresyincy=all if citizenshipyesprofile==1 & residentyesprofile==1 & incometaxyesprofile==1
gen cityresyincn=all if citizenshipyesprofile==1 & residentyesprofile==1 & incometaxyesprofile==0
gen cityresnincy=all if citizenshipyesprofile==1 & residentyesprofile==0 & incometaxyesprofile==1
gen cityresnincn=all if citizenshipyesprofile==1 & residentyesprofile==0 & incometaxyesprofile==0
gen citnresyincy=all if citizenshipyesprofile==0 & residentyesprofile==1 & incometaxyesprofile==1
gen citnresyincn=all if citizenshipyesprofile==0 & residentyesprofile==1 & incometaxyesprofile==0
gen citnresnincy=all if citizenshipyesprofile==0 & residentyesprofile==0 & incometaxyesprofile==1
gen citnresnincn=all if citizenshipyesprofile==0 & residentyesprofile==0 & incometaxyesprofile==0
// Generating variables that indicate each relevant subset of profiles

gen subset=. // Generating and labelling a categorical subset variable 
replace subset=8 if cityresyincy==1
replace subset=7 if cityresyincn==1
replace subset=6 if cityresnincy==1
replace subset=5 if cityresnincn==1
replace subset=4 if citnresyincy==1
replace subset=3 if citnresyincn==1
replace subset=2 if citnresnincy==1
replace subset=1 if citnresnincn==1
label define Profile 8 "Tax paying, resident citizens" ///
7 "Non-tax paying, resident citizens" 6 "Tax paying, non-resident citizens" ///
5 "Non-tax paying, non-resident citizens" 4 "Tax paying, resident non-citizens" ///
3 "Non-tax paying, resident non-citizens" 2 "Tax paying, non-resident non-citizens" ///
1 "Non-tax paying, non-resident non-citizens" 
label values subset Profile

reg allowno i.subset if all==1 & subset>4$ses // Regressing subsets on preference for disenfranchising the profile
margins, at(subset=(5(1)8)) //  Mean preference for each subset, by margins 
marginsplot, horizontal yline(5(1)8, lwidth (vthin) lcolor(gray*.5)) ///
xline(0(0.1).4, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) ///
xscale(range(0,.4)) xlabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%") ///
ytitle("") title("Main model (N =4,372)", size(msmall)) ///
xtitle("Support for disenfranchisement") aspect(.2)

* C1 Second panel: model including inconsistent respondents

gen icityresyincy=1 if citizenshipyesprofile==1 & residentyesprofile==1 & incometaxyesprofile==1
gen icityresyincn=1 if citizenshipyesprofile==1 & residentyesprofile==1 & incometaxyesprofile==0
gen icityresnincy=1 if citizenshipyesprofile==1 & residentyesprofile==0 & incometaxyesprofile==1
gen icityresnincn=1 if citizenshipyesprofile==1 & residentyesprofile==0 & incometaxyesprofile==0
gen icitnresyincy=1 if citizenshipyesprofile==0 & residentyesprofile==1 & incometaxyesprofile==1
gen icitnresyincn=1 if citizenshipyesprofile==0 & residentyesprofile==1 & incometaxyesprofile==0
gen icitnresnincy=1 if citizenshipyesprofile==0 & residentyesprofile==0 & incometaxyesprofile==1
gen icitnresnincn=1 if citizenshipyesprofile==0 & residentyesprofile==0 & incometaxyesprofile==0
// Preparing by generating variables for each subset but not restricted to 
// attentive respondents.

gen inclusivesubset=. // // Generating and labelling a categorical subset variable 
replace inclusivesubset=8 if icityresyincy==1
replace inclusivesubset=7 if icityresyincn==1
replace inclusivesubset=6 if icityresnincy==1
replace inclusivesubset=5 if icityresnincn==1
replace inclusivesubset=4 if icitnresyincy==1
replace inclusivesubset=3 if icitnresyincn==1
replace inclusivesubset=2 if icitnresnincy==1
replace inclusivesubset=1 if icitnresnincn==1
label define inclusiveprofile 8 "Tax paying, resident citizens" ///
7 "Non-tax paying, resident citizens" 6 "Taxpaying, non-resident citizens" ///
5 "Non-taxpaying, non-resident citizens" 4 "Tax paying, resident non-citizens" ///
3 "Non-tax paying, resident non-citizens" 2 "Taxpaying, non-resident non-citizens" ///
1 "Non-taxpaying, non-resident non-citizens" 
label values inclusivesubset inclusiveprofile

reg allowno i.inclusivesubset if use==1 & inclusivesubset>4$ses
margins, at(inclusivesubset=(5(1)8))
marginsplot, horizontal yline(5(1)8, lwidth (vthin) lcolor(gray*.5)) ///
xline(0(0.1).4, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) ///
xscale(range(0,.4)) xlabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%") ///
ytitle("") title("Inconsistent respondents included (N = 5,829)", size(msmall)) ///
xtitle("Support for disenfranchisement") aspect(.2)

* C1 Third panel: model excludng neutral ratings

reg allowno i.subset if all==1 & subset>4 & ratingprofile!=4$ses
margins, at(subset=(5(1)8))
marginsplot, horizontal yline(5(1)8, lwidth (vthin) lcolor(gray*.5)) ///
xline(0(0.1).4, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) ///
xscale(range(0,.4)) xlabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%") ///
ytitle("") title("Excluding neutral ratings (N =3,991)", size(msmall)) ///
xtitle("Support for disenfranchisement") aspect(.2)


* Figure C2. Support for diserfranchising subsets of taxpaying, resident citizens.

gen leastdisenfsubset=1 if subset==8 // Generate a categorical variable for each subset
replace leastdisenfsubset=leastdisenfsubset+1 if profileedu>3
replace leastdisenfsubset=leastdisenfsubset+2 if usbornprofile==1 
label define leastdisen 1 "Foreign born with education less than bachelor" ///
2 "Foreign born with education bachelor or more" ///
3 "US born with education less than bachelor" ///
4 "US born with education bachelor or more"
label values leastdisenfsubset leastdisen

reg allowno i.leastdisenfsubset if all==1
margins, at(leastdisenfsubset=(1(1)4))
marginsplot, horizontal yline(1(1)4, lwidth (vthin) lcolor(gray*.5)) ///
xline(0, lwidth (vthin)) graphregion(fcolor(white)) ///
ciopts(lcolor(black) lwidth(*1)) recast(dot) plotopts(ndots(1)) scheme(lean1) ///
xscale(range(0,.55)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" ) ytitle("") ///
title("Support for disenfrachising subsets of profiles that are tax-paying, resident citizens", size(medsmall)) ///
xtitle("Support for disfranchisement", size (medsmall)) aspect (.2)


* Figure C3. Support for disenfranchising naturalized and US born citizens

gen naturalizationsubset=. // Generate a categorical variable for each subset
replace naturalizationsubset=2 if usbornprofile==0 & citizenshipyesprofile==1
replace naturalizationsubset=1 if usbornprofile==1 & citizenshipyesprofile==1
label define naturalizedprofile 2 "Naturalized citizens" ///
1 "US born citizens" 
label values naturalizationsubset naturalizedprofile

reg allowno i.naturalizationsubset if all==1$ses
margins, at(naturalizationsubset=(1(1)2))
marginsplot, horizontal yline(1(1)2, lwidth (vthin) lcolor(gray*.5)) ///
xline(0.5, lwidth (vthin)) graphregion(fcolor(white)) ciopts(lcolor(black) ///
lwidth(*1)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) ///
xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") ///
title("") xtitle("Support for disenfranchisement", size (medsmall)) aspect(.06)

tab naturalizationsubset if all==1 // For N reported at page 11.

* Figure C4. Support for enfranchising least preferred profiles

gen leastenfsubset=1 if subset==1 
replace leastenfsubset=leastenfsubset+1 if profileedu>1
replace leastenfsubset=leastenfsubset+2 if mexicobornprofile==1 
replace leastenfsubset=leastenfsubset+2 if philippnesbornprofile==1 
replace leastenfsubset=leastenfsubset+2 if somaliabornprofile==1 
label define leastenfra 1 "U.S. or Canada born with less than high-school" ///
2 "U.S. or Canada born with high-school or more" ///
3 "Non-North America born with less than high-school" ///
4 "Non-North America born with high-school or more"
label values leastenfsubset leastenfra

reg allowyes i.leastenfsubset if all==1
margins, at(leastenfsubset=(1(1)4))
marginsplot, horizontal yline(1(1)4, lwidth (vthin) lcolor(gray*.5)) ///
xline(0, lwidth (vthin)) graphregion(fcolor(white)) ///
ciopts(lcolor(black) lwidth(*1)) recast(dot) plotopts(ndots(1)) scheme(lean1) ///
xscale(range(0,.55)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" ) ytitle("") ///
title("Support for enfrachising subsets of profiles that are neither tax-paying, resident, nor citizen", size(medsmall)) ///
xtitle("Support for enfranchisement", size (medsmall)) aspect (.2)

* Figure C5. Support for enfranchisement of resident non-citizens from Mexico
* and other countries.

gen citnres15incy=all if citizenshipyesprofile==0 & us15profile==1 & incometaxyesprofile==1
gen citnres3incy=all if citizenshipyesprofile==0 & us3profile==1 & incometaxyesprofile==1
gen citnres15incn=all if citizenshipyesprofile==0 & us15profile==1  & incometaxyesprofile==0
gen citnres3incn=all if citizenshipyesprofile==0 & us3profile==1  & incometaxyesprofile==0
// Variables indicating each relevant subset of profiles for allowyes

gen allowyessubset=. // Generate a categorical variable for each subset
replace allowyessubset=6 if citnres15incy==1
replace allowyessubset=5 if citnres3incy==1
replace allowyessubset=4 if citnres15incn==1
replace allowyessubset=3 if citnres3incn==1
replace allowyessubset=2 if citnresnincy==1
replace allowyessubset=1 if citnresnincn==1
label define profileallowyess 6 "Tax paying, 15 years resident non-citizen" ///
5 "Tax paying, 3 years resident non-citizen" 4 "Non-tax paying, 15 years resident non-citizen" ///
3 "Non-tax paying, 3 years resident non-citizen" ///
2 "Tax paying, non-resident non-citizen" ///
1 "Non-tax paying, non-resident non-citizen" 
label values allowyessubset profileallowyess

* C5 First panel. Reference figure including profiles from all countries

reg allowyes i.allowyessubset if all==1 $ses
margins, at(allowyessubset=(3(1)6)) // level 3-6 cover all resident non-citizen profiles
marginsplot, horizontal yline(3(1)6, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) graphregion(fcolor(white)) ciopts(lcolor(black) lwidth(*1)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Profiles from any country of origin") xtitle("Support for enfranchisement", size (medsmall)) aspect (.2)

* C5 Second panel. Profiles for all countries but Mexico 
reg allowyes i.allowyessubset if all==1 & mexicobornprofile==0 $ses
margins, at(allowyessubset=(3(1)6))
marginsplot, horizontal yline(3(1)6, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) graphregion(fcolor(white)) ciopts(lcolor(black) lwidth(*1)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Profiles from all countries but Mexico") xtitle("Support for enfranchisement", size (medsmall)) aspect (.2)

* C5 Third panel. Profiles from Mexico only
reg allowyes i.allowyessubset if all==1 & mexicobornprofile==1 $ses
margins, at(allowyessubset=(3(1)6))
marginsplot, horizontal yline(3(1)6, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) graphregion(fcolor(white)) ciopts(lcolor(black) lwidth(*1)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Profiles from Mexico only") xtitle("Support for enfranchisement", size (medsmall)) aspect (.2)

* Figure C6. Comparison between young respondents and old (under 45/45 or older) respondents
tab age // For median age

gen agesubset=subset*2
replace agesubset=agesubset-1 if age>44
replace agesubset=. if age==.
label define profileagerespo 16 "Tax paying, resident citizen ({it:rated by respondents below median age})" ///
15 "({it:rated by respondents above median age})" ///
14 "Non-tax paying, resident citizen ({it:young})" 13 "({it:old})" ///
12 "Taxpaying, non-resident citizen ({it:young})" 11 "({it:old})" ///
10 "Non-taxpaying, non-resident citizen ({it:young})" 9 "({it:old})" ///
8 "Tax paying, resident non-citizen ({it:young})" 7 "({it:old})" ///
6 "Non-tax paying, resident non-citizen ({it:young})" 5 "({it:old})" ///
4 "Taxpaying, non-resident non-citizen ({it:young})" 3 "({it:old})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:young})" 1 "({it:old})" 
label values agesubset profileagerespo

reg allowyes i.agesubset if all==1 & ratingprofile!=4
margins, at(agesubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences among respondents split by age", size(msmall)) xtitle("Support for franchise", size(msmall))

* Figure C7. Comparison between female and male respondents 
gen gendersubset=subset*2
replace gendersubset=gendersubset-1 if genderrespondent==0
replace gendersubset=. if genderrespondent==.
label define profilegenderrespo 16 "Tax paying, resident citizen ({it:rated by women})" ///
15 "({it:rated by men})" ///
14 "Non-tax paying, resident citizen ({it:women})" 13 "({it:men})" ///
12 "Taxpaying, non-resident citizen ({it:women})" 11 "({it:men})" ///
10 "Non-taxpaying, non-resident citizen ({it:women})" 9 "({it:men})" ///
8 "Tax paying, resident non-citizen ({it:women})" 7 "({it:men})" ///
6 "Non-tax paying, resident non-citizen ({it:women})" 5 "({it:men})" ///
4 "Taxpaying, non-resident non-citizen ({it:women})" 3 "({it:men})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:women})" 1 "({it:men})" 
label values gendersubset profilegenderrespo

reg allowyes i.gendersubset if all==1 & ratingprofile!=4
margins, at(gendersubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences among female and male respondents", size(msmall)) xtitle("Support for franchise", size(msmall))

* Figure C8. Comparison between less and more educated respondents 
gen edusubset=subset*2-1
replace edusubset=edusubset+1 if educationrespondent>4
replace edusubset=. if educationrespondent==3
replace edusubset=. if educationrespondent==4
replace edusubset=. if educationrespondent==.
label define profileedurespo 16 "Tax paying, resident citizen ({it:rated by less educ})" ///
15 "({it:rated by more educ})" ///
14 "Non-tax paying, resident citizen ({it:less educ})" 13 "({it:more educ})" ///
12 "Taxpaying, non-resident citizen ({it:less educ})" 11 "({it:more educ})" ///
10 "Non-taxpaying, non-resident citizen ({it:less educ})" 9 "({it:more educ})" ///
8 "Tax paying, resident non-citizen ({it:less educ})" 7 "({it:more educ})" ///
6 "Non-tax paying, resident non-citizen ({it:less educ})" 5 "({it:more educ})" ///
4 "Taxpaying, non-resident non-citizen ({it:less educ})" 3 "({it:more educ})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:less educ})" 1 "({it:more educ})" 
label values edusubset profileedurespo

reg allowyes i.edusubset if all==1 & ratingprofile!=4
margins, at(edusubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences among respondents split by educational attainment", size(msmall)) xtitle("Support for franchise", size(msmall))

* Figure C9. Comparison between US born and foreign born respondents 
gen bornsubset=subset*2
replace bornsubset=bornsubset-1 if usbornrespondent==0
replace bornsubset=. if usbornrespondent==.
label define profilebornrespo 16 "Tax paying, resident citizen ({it:rated by US born resp only})" ///
15 "({it:rated by foreign born respondents only})" ///
14 "Non-tax paying, resident citizen ({it:US born})" 13 "({it:foreign born})" ///
12 "Taxpaying, non-resident citizen ({it:US born})" 11 "({it:foreign born})" ///
10 "Non-taxpaying, non-resident citizen ({it:US born})" 9 "({it:foreign born})" ///
8 "Tax paying, resident non-citizen ({it:US born})" 7 "({it:foreign born})" ///
6 "Non-tax paying, resident non-citizen ({it:US born})" 5 "({it:foreign born})" ///
4 "Taxpaying, non-resident non-citizen ({it:US born})" 3 "({it:foreign born})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:US born})" 1 "({it:foreign born})" 
label values bornsubset profilebornrespo

reg allowyes i.bornsubset if all==1 & ratingprofile!=4
margins, at(bornsubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences among US born and foreign born respondents", size(msmall)) xtitle("Support for franchise", size(msmall))

* Figure 10. Comparison between respondents with or w/o some kind of employment
gen employedsubset=subset*2-1
replace employedsubset=employedsubset+1 if employment<5
replace employedsubset=. if employment==.
label define profilemployresp 16 "Tax paying, resident citizen ({it:rated by respondents w/o employment only})" ///
15 "({it:rated by employed respondents only})" ///
14 "Non-tax paying, resident citizen ({it:not employed})" 13 "({it:employed})" ///
12 "Taxpaying, non-resident citizen ({it:not employed})" 11 "({it:employed})" ///
10 "Non-taxpaying, non-resident citizen ({it:not employed})" 9 "({it:employed})" ///
8 "Tax paying, resident non-citizen ({it:not employed})" 7 "({it:employed})" ///
6 "Non-tax paying, resident non-citizen ({it:not employed})" 5 "({it:employed})" ///
4 "Taxpaying, non-resident non-citizen ({it:not employed})" 3 "({it:employed})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:not employed})" 1 "({it:employed})" 
label values employedsubset profilemployresp

reg allowyes i.employedsubset if all==1 & ratingprofile!=4
margins, at(employedsubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences among respondents split by employment status", size(msmall)) xtitle("Support for franchise", size(msmall))

* Figure 11. Comparison between unemployed and permanetly employed respondents (excluding students, retired and home-makers)
gen unemployedsubset=subset*2
replace unemployedsubset=unemployedsubset-1 if employment==4
replace unemployedsubset=. if employment<4
replace unemployedsubset=. if employment==5
replace unemployedsubset=. if employment==.
label define profileunemployedrespo 16 "Tax paying, resident citizen ({it:rated by perm.empl.})" ///
15 "({it:rated by unempl.})" ///
14 "Non-tax paying, resident citizen ({it:permanently employed})" 13 "({it:unemployed})" ///
12 "Taxpaying, non-resident citizen ({it:permanently employed})" 11 "({it:unemployed})" ///
10 "Non-taxpaying, non-resident citizen ({it:permanently employed})" 9 "({it:unemployed})" ///
8 "Tax paying, resident non-citizen ({it:permanently employed})" 7 "({it:unemployed})" ///
6 "Non-tax paying, resident non-citizen ({it:permanently employed})" 5 "({it:unemployed})" ///
4 "Taxpaying, non-resident non-citizen ({it:permanently employed})" 3 "({it:unemployed})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:permanently employed})" 1 "({it:unemployed})" 
label values unemployedsubset profileunemployedrespo

reg allowyes i.unemployedsubset if all==1 & ratingprofile!=4
margins, at(unemployedsubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences among unemployed and permanently employed respondents", size(msmall)) xtitle("Support for franchise", size(msmall))

* Figure 12. Comparison between respondents with high low and high household income (1st and 4th quartile) 
gen incomesubset=subset*2
replace incomesubset=incomesubset-1 if householdincome>4
replace incomesubset=. if householdincome==4
replace incomesubset=. if householdincome==3
replace incomesubset=. if householdincome==2
replace incomesubset=. if householdincome==.
label define profilincomerespo 16 "Tax paying, resident citizen ({it:rated by low income  quartile})" ///
15 "({it:rated by high income quartile})" ///
14 "Non-tax paying, resident citizen ({it:low income})" 13 "({it:high income})" ///
12 "Taxpaying, non-resident citizen ({it:low income})" 11 "({it:high income})" ///
10 "Non-taxpaying, non-resident citizen ({it:low income})" 9 "({it:high income})" ///
8 "Tax paying, resident non-citizen ({it:low income})" 7 "({it:high income})" ///
6 "Non-tax paying, resident non-citizen ({it:low income})" 5 "({it:high income})" ///
4 "Taxpaying, non-resident non-citizen ({it:low income})" 3 "({it:high income})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:low income})" 1 "({it:high income})" 
label values incomesubset profilincomerespo

reg allowyes i.incomesubset if all==1 & ratingprofile!=4
margins, at(incomesubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences among respondents split by household income (1st and 4th quartile)", size(msmall)) xtitle("Support for franchise", size(msmall))

* Figure 13. Comparison between prodemocratic respondents and non-prodemocratic respondents

gen dichdemocracy = 0
replace dichdemocracy = 1 if importanceofdemocracy == 5
replace dichdemocracy = 1 if importanceofdemocracy == 6
replace dichdemocracy = 1 if importanceofdemocracy == 7	

gen dichdemsubset=subset*2
replace dichdemsubset=dichdemsubset-1 if dichdemocracy==0
replace dichdemsubset=. if dichdemocracy==.
label define profiledemorespon 1 "({it:non-pro})" ///
2 "Non-taxpaying, non-resident non-citizen ({it:prodemocrats})" ///
3 "({it:non-pro})" 4 "Taxpaying, non-resident non-citizen ({it:prodemocrats})" ///
5 "({it:non-pro})" 6 "Non-tax paying, resident non-citizen ({it:prodemocrats})" ///
7 "({it:non-pro})" 8 "Tax paying, resident non-citizen ({it:prodemocrats})" ///
9 "({it:non-pro})" 10 "Non-taxpaying, non-resident citizen ({it:prodemocrats})" ///
11 "({it:non-pro})" 12 "Taxpaying, non-resident citizen ({it:prodemocrats})" ///
13 "({it:non-pro})" 14 "Non-tax paying, resident citizen ({it:prodemocrats})" ///
15 "({it:non-prodemcratic respondents only)}" ///
16 "Tax paying, resident citizen ({it:prodemocratic respondents only})"
label values dichdemsubset profiledemorespon

reg allowyes i.dichdemsubset if all==1 & ratingprofile!=4
margins, at(dichdemsubset=(1(1)16))
marginsplot, horizontal yline(1(1)16, lwidth (vthin) lcolor(gray*.5)) xline(0.5, lwidth (vthin)) recast(dot) plotopts(ndots(1)) scheme(lean1) xscale(range(0,1)) xlabel(0 "0%" 0.25 "25%" 0.5 "50%" 0.75 "75%" 1.0 "100%") ytitle("") title("Preferences for franchise among prodemocratic respondents and non-prodemcratic", size(msmall)) xtitle("Support for franchise", size(msmall))


* END OF DO FILE *
